package com.guoyansoft.model.dao;

import com.guoyansoft.model.pojo.CustomerAndAddress;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
@Mapper
public interface CustomerAndAddressDao {
    /**
     * @author 常利军
     * @return 返回用户与地址中间实体的集合
     */
    List<CustomerAndAddress> selectAll();

    /**
     * 新增实体信息
     * @param customerAndAddress 用户与地址中间实体
     * @return
     */
    int insert(CustomerAndAddress customerAndAddress);

    /**
     * 根据用户id查用户对应的地址
     * @param customerId
     * @return
     */
    List<CustomerAndAddress> selectByCustomerId(Integer customerId);

    /**
     * 删除
     * @param customerAndAddress
     * @return
     */
    Long delete(CustomerAndAddress customerAndAddress);

    /**
     * 根据address对应的id删除相应的信息
     * @param customerAndAddress
     * @return
     */
    Long deleteByAddressId(CustomerAndAddress customerAndAddress);

    /**
     * 根据customerId查addressId
     * @param customerAndAddress
     * @return
     */
    List<CustomerAndAddress> selectByCustomerIds(CustomerAndAddress customerAndAddress);
}
